{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import math\n",
    "import torch\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "dat = np.load(\"./rotated_faces_data.npz\")\n",
    "train_images = torch.tensor(dat['train_images'])\n",
    "train_targets = torch.tensor(dat['train_angles'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "traindata = torch.utils.data.TensorDataset(train_images, train_targets)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "trainloader = torch.utils.data.DataLoader(traindata, batch_size=128)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "x, y = next(iter(trainloader))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "torch.Size([128, 45, 45, 1])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([-78.5460, -14.1014, -76.0971, -69.4203,  17.8528,  12.9154,  20.4845,\n",
       "        -75.8785,  35.0649, -39.3827, -30.5879, -66.2347,  30.6763,  82.5264,\n",
       "         73.6547,  84.0268, -75.6552, -18.4763,  -1.6627, -17.5010,  31.8910,\n",
       "        -79.5599,  49.0537,  30.1283,  58.6712, -88.5410,  82.5207, -32.4113,\n",
       "         -3.9054, -27.9118, -42.1160, -65.0331, -89.9798,  -5.2168, -18.5822,\n",
       "        -70.8407, -45.6890,   6.6707, -79.7261, -18.1816, -41.2957, -82.4604,\n",
       "        -60.4526, -80.7294, -73.0383,  45.0692, -49.5779,  57.8968, -18.7050,\n",
       "         83.6029, -13.1850,  88.7368, -37.4646,  26.8518, -52.5797, -38.3378,\n",
       "         32.0954,  58.1756,  39.0916, -42.2490,  39.5454, -19.3416, -51.7244,\n",
       "        -63.9330,   8.5863, -66.2629, -74.4436,  23.2293, -70.8969,  41.4836,\n",
       "        -48.7049,  55.2687,  30.0301,  -3.7292, -85.4013,  68.3631, -74.5061,\n",
       "        -39.4584,  34.4313, -73.1262,  79.8977,   9.4600, -75.7082, -43.9097,\n",
       "        -43.4138,   7.9166, -31.4808,  49.7975,  37.0091, -23.6533,  17.2942,\n",
       "        -80.4598,   4.8585,  77.9835,  53.9726,  72.1562,  77.2189,  -9.3236,\n",
       "        -48.2194, -83.3318,  76.3335,  72.4137, -22.2909,  22.5637, -52.6273,\n",
       "        -51.9835, -14.5876,  72.0980, -22.2989, -66.9330, -45.0245, -42.8406,\n",
       "         54.5626, -42.3758, -70.8278, -12.6824, -74.6058,  85.0527,  59.6711,\n",
       "        -85.8519,  24.2349,  48.6389, -12.5999,   8.2732, -83.1830,   0.6274,\n",
       "         -1.6200, -77.0179], dtype=torch.float64)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
